package com.sansecy.leanbacktest;

import java.util.ArrayList;
import java.util.List;

public final class MovieList {
    public static final String MOVIE_CATEGORY[] = {"Category Zero", "Category One", "Category Two", "Category Three", "Category Four", "Category Five",};

    private static List<Movie> list;
    private static long count = 0;

    public static List<Movie> getList()
    {
        if (list == null)
        {
            list = setupMovies();
        }
        return list;
    }

    public static List<Movie> setupMovies()
    {



        list = new ArrayList<>();
        String title[] = {"Zeitgeist 2010_ Year in Review", "Google Demo Slam_ 20ft Search", "Introducing Gmail Blue", "Introducing Google Fiber to the Pole", "Introducing Google Nose"};

        String description = "Fusce id nisi turpis. Praesent viverra bibendum semper. " + "Donec tristique, orci sed semper lacinia, quam erat rhoncus massa, non congue tellus est " + "quis tellus. Sed mollis orci venenatis quam scelerisque accumsan. Curabitur a massa sit " + "amet mi accumsan mollis sed et magna. Vivamus sed aliquam risus. Nulla eget dolor in elit " + "facilisis mattis. Ut aliquet luctus lacus. Phasellus nec commodo erat. Praesent tempus id " + "lectus ac scelerisque. Maecenas pretium cursus lectus id volutpat.";
        String studio[] = {"Studio Zero", "Studio One", "Studio Two", "Studio Three", "Studio Four"};
        String videoUrl[] = {"http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Zeitgeist/Zeitgeist%202010_%20Year%20in%20Review.mp4", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Demo%20Slam/Google%20Demo%20Slam_%2020ft%20Search.mp4", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Gmail%20Blue.mp4", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Google%20Fiber%20to%20the%20Pole.mp4", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Google%20Nose.mp4"};
        String bgImageUrl[] = {"http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Zeitgeist/Zeitgeist%202010_%20Year%20in%20Review/bg.jpg", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Demo%20Slam/Google%20Demo%20Slam_%2020ft%20Search/bg.jpg", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Gmail%20Blue/bg.jpg", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Google%20Fiber%20to%20the%20Pole/bg.jpg", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Google%20Nose/bg.jpg",};
        String cardImageUrl[] = {"http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Zeitgeist/Zeitgeist%202010_%20Year%20in%20Review/card.jpg", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/Demo%20Slam/Google%20Demo%20Slam_%2020ft%20Search/card.jpg", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Gmail%20Blue/card.jpg", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Google%20Fiber%20to%20the%20Pole/card.jpg", "http://commondatastorage.googleapis.com/android-tv/Sample%20videos/April%20Fool's%202013/Introducing%20Google%20Nose/card.jpg"};

        for (int index = 0; index < title.length; ++index)
        {
            list.add(buildMovieInfo(title[index], description, studio[index], videoUrl[index], cardImageUrl[index], bgImageUrl[index]));
        }

        return list;
    }

    private static Movie buildMovieInfo(String title, String description, String studio, String videoUrl, String cardImageUrl, String backgroundImageUrl)
    {
        Movie movie = new Movie();
        movie.setId(count++);
        movie.setTitle(title);
        movie.setDescription(description);
        movie.setStudio(studio);
        movie.setCardImageUrl(cardImageUrl);
        movie.setBackgroundImageUrl(backgroundImageUrl);
        movie.setVideoUrl(videoUrl);
        return movie;
    }
}